<template>
    <div class="pop-contact-info">
        <el-drawer
            title="联系信息设置"
            :visible.sync="is_drawer"
            class="drawer-box"
        >
            <div class="context-box">
                <el-form ref="form" :model="form.touchme" label-width="80px">
                    <el-form-item label="对应产品">
                        <el-radio v-model="form.touchme.type" label="1"
                            >全部产品</el-radio
                        >
                        <el-radio v-model="form.touchme.type" label="2"
                            >部分产品</el-radio
                        >
                    </el-form-item>
                    <el-form-item prop="tyminput" v-show="form.touchme.type == 2" >
                        <el-checkbox-group v-model="listArr" @change="changeFun" >
                            <el-checkbox
                                v-for="(item, good_index) in form.gd_ls"
                                :key="good_index"
                                :label="item.id"
                                >{{ item.gd_title}}</el-checkbox>
                        </el-checkbox-group>
                    </el-form-item>
                </el-form>
            </div>
        </el-drawer>
    </div>
</template>

<script>
// import xxx from '@/components/comm/xxx.vue';
export default {
    props: ["form"],
    components: {},
    computed: {},
    data() {
        return {
            is_drawer: false,
            listArr: [],
        };
    },
    watch: {
        form: {
            handler(newName, oldName) {
                this.listArr = JSON.parse(JSON.stringify(this.form.touchme.gdid_ls))|| []
            },
            immediate: true,
            deep: true
        }
    },
    created() {
    },
    mounted() {
    },
    methods: {
        changeFun (e) {
            this.$emit('gdidlsChange',e)
        },
        initData() {
            this.is_drawer = true;
        },
    },
};
</script>

<style lang="scss" scoped >
.drawer-box {
    .context-box {
        padding: 0 20px;
    }
}
</style>
